﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RoadTeam.Standard;
using RoadTeam.BLL;
using System.Data;

namespace RoadTeam.Pase
{
    public class PaseStaff
    {
        /// <summary>
        /// 验证登陆信息
        /// </summary>
        /// <param name="LoginID">用户登陆名</param>
        /// <param name="Pwd">用户密码</param>
        /// <returns>用户登录信息</returns>
        public static LoginInfo CheckLogin(String LoginID, String Pwd)
        {


            BllBase bllbase = new BllBase();
            //bllbase.InserLog("方法名[GetUnitData]调用时间[" + DateTime.Now.ToString() + "]参数:[" + OrganIdentifier + "]");
            bllbase.InsertLog("方法名[CheckLogin]调用时间[" + DateTime.Now.ToString() + "]参数为:[" + LoginID + "][" + Pwd + "]",
@"RoadTeam.Pase.PaseStaff", "public static LoginInfo CheckLogin(String LoginID, String Pwd)");


            SysUserBLL bll = new SysUserBLL();
            DataTable dt = bll.GetLoginInfo(LoginID, Pwd);
            LoginInfo info = new LoginInfo();
            if (dt.Rows.Count == 0)
            {
                info.IsLoginSuccess = false;
            }
            else
            {
                info.IsLoginSuccess = true;
                info.UserIdentifier = dt.Rows[0]["UserIdentifier"].ToString();
                info.UserName = dt.Rows[0]["UserName"].ToString();
                info.UserLoginID = dt.Rows[0]["UserLoginID"].ToString();
                info.UserTypeName = dt.Rows[0]["UserTypeName"].ToString();
                info.OrganIdentifier = dt.Rows[0]["OrganIdentifier"].ToString();
            }
            return info;
        }

    }
}
